<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //  async 函数的返回值是 Promise 对象
      async function setupAsync() {
        return { msg: '成功提示' }
      }
      
      // 等同于 - 和 async 函数等价
      function setupPromise() {
        return new Promise((resolve, reject) => {
          resolve({ msg: '成功提示' })
        })
      }

      const result1 = setupAsync()
      const result2 = setupPromise()
      console.log(result1) // Promise 对象
      console.log(result2) // Promise 对象
    </script>
  </body>
</html>
